<template>
	<!-- <view> -->
		<view class="allBox">
			<template v-for="(item,index) in contentYInArr" :key="index">
				<dl-square class="allBox-item" :classTol="'共'+item.classTol+'课'" :className="item.className" @change="changeSque(item)" :src="item.src"></dl-square>
			</template>				
		</view>
	<!-- </view> -->
</template>

<script>
	export default {
		data() {
			return {
				contentYInArr: []
			}
		},
		methods: {
			changeSque(item){
				uni.navigateTo({
					url: '/uni_modules/cartoon-details/components/cartoon-details/cartoon-details?item='+encodeURIComponent(JSON.stringify(item))
				})
			}
		},
		onShow:function(){
			this.contentYInArr = this.$store.state.cartoonData.classesYing;
		}
	}
</script>

<style scoped>
	.allBox{
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		padding: 20rpx;		
	}
	.allBox-item{
		flex-basis: 48%;
		background-color: aliceblue;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		overflow: hidden;
	}
</style>
